package org.jeecg.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 历史订单完成15天后同步到历史订单同步表中，通过canal同步到历史订单库中；1天后删除（删除条件当天数据和历史订单库中的订单数据数量一致）
 * @TableName history_orders_sync
 */
@TableName(value ="history_orders_sync")
@Data
public class HistoryOrdersSync implements Serializable {
    /**
     * 订单id
     */
    @TableId
    private String id;

    /**
     * 订单所属人
     */
    private Long userId;

    /**
     * 服务类型id
     */
    private Long serveTypeId;

    /**
     * 服务人
     */
    private Long serveProviderId;

    /**
     * 服务人类型，2：服务人员，3：机构
     */
    private Integer serveProviderType;

    /**
     * 服务项id
     */
    private Long serveItemId;

    /**
     * 服务id
     */
    private Long serveId;

    /**
     * 城市编码
     */
    private String cityCode;

    /**
     * 服务类型名称
     */
    private String serveTypeName;

    /**
     * 服务项名称
     */
    private String serveItemName;

    /**
     * 服务项图片
     */
    private String serveItemImg;

    /**
     * 服务单位
     */
    private Integer unit;

    /**
     * 订单状态，500：订单完成，600：已取消，700：已关闭
     */
    private Integer ordersStatus;

    /**
     * 支付状态，1：支付成功，2：已关闭
     */
    private Integer payStatus;

    /**
     * 退款状态
     */
    private Integer refundStatus;

    /**
     * 订单完成时间
     */
    private Date tradeFinishTime;

    /**
     * 支付渠道，ALI_PAY：支付宝，WECHAT_PAY：微信
     */
    private String tradingChannel;

    /**
     * 支付流水
     */
    private String thirdOrderId;

    /**
     * 派单时间
     */
    private Date dispatchTime;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 购买数量
     */
    private Integer purNum;

    /**
     * 订单总金额
     */
    private BigDecimal totalAmount;

    /**
     * 实际支付金额
     */
    private BigDecimal realPayAmount;

    /**
     * 退款流水
     */
    private String thirdRefundOrderId;

    /**
     * 取消人姓名
     */
    private String cancelerName;

    /**
     * 优惠金额
     */
    private BigDecimal discountAmount;

    /**
     * 服务详细地址
     */
    private String serveAddress;

    /**
     * 联系人手机号
     */
    private String contactsPhone;

    /**
     * 联系人姓名
     */
    private String contactsName;

    /**
     * 服务人姓名
     */
    private String serveProviderStaffName;

    /**
     * 服务人手机号
     */
    private String serveProviderStaffPhone;

    /**
     * 机构名称
     */
    private String institutionName;

    /**
     * 机构电话
     */
    private String institutionPhone;

    /**
     * 下单时间
     */
    private Date placeOrderTime;

    /**
     * 服务开始时间
     */
    private Date serveStartTime;

    /**
     * 服务结束时间
     */
    private Date serveEndTime;

    /**
     * 实际服务开始时间
     */
    private Date realServeStartTime;

    /**
     * 实际服务结束时间
     */
    private Date realServeEndTime;

    /**
     * 服务开始图片
     */
    private Object serveBeforeImgs;

    /**
     * 服务开始说明
     */
    private String serveBeforeIllustrate;

    /**
     * 服务完成图片
     */
    private Object serveAfterImgs;

    /**
     * 服务完成说明
     */
    private String serveAfterIllustrate;

    /**
     * 支付超时时间，该时间只对待支付有意义
     */
    private Date paymentTimeout;

    /**
     * 经度
     */
    private Double lon;

    /**
     * 纬度
     */
    private Double lat;

    /**
     * 支付时间
     */
    private Date payTime;

    /**
     * 取消/被退单时间
     */
    private Date cancelTime;

    /**
     * 取消/被退单原因
     */
    private String cancelReason;

    /**
     * 下单年份,格式：yyyy
     */
    private Integer year;

    /**
     * 下单月份,格式：yyyyMM
     */
    private Integer month;

    /**
     * 下单所在日,格式：yyyyMMdd
     */
    private Integer day;

    /**
     * 下单所在小时，格式：yyyyMMddHH
     */
    private Integer hour;

    /**
     * 排序时间字段
     */
    private Date sortTime;

    /**
     * 
     */
    private Date updateTime;

    /**
     * 
     */
    private Date sync;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        HistoryOrdersSync other = (HistoryOrdersSync) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getServeTypeId() == null ? other.getServeTypeId() == null : this.getServeTypeId().equals(other.getServeTypeId()))
            && (this.getServeProviderId() == null ? other.getServeProviderId() == null : this.getServeProviderId().equals(other.getServeProviderId()))
            && (this.getServeProviderType() == null ? other.getServeProviderType() == null : this.getServeProviderType().equals(other.getServeProviderType()))
            && (this.getServeItemId() == null ? other.getServeItemId() == null : this.getServeItemId().equals(other.getServeItemId()))
            && (this.getServeId() == null ? other.getServeId() == null : this.getServeId().equals(other.getServeId()))
            && (this.getCityCode() == null ? other.getCityCode() == null : this.getCityCode().equals(other.getCityCode()))
            && (this.getServeTypeName() == null ? other.getServeTypeName() == null : this.getServeTypeName().equals(other.getServeTypeName()))
            && (this.getServeItemName() == null ? other.getServeItemName() == null : this.getServeItemName().equals(other.getServeItemName()))
            && (this.getServeItemImg() == null ? other.getServeItemImg() == null : this.getServeItemImg().equals(other.getServeItemImg()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getOrdersStatus() == null ? other.getOrdersStatus() == null : this.getOrdersStatus().equals(other.getOrdersStatus()))
            && (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus()))
            && (this.getRefundStatus() == null ? other.getRefundStatus() == null : this.getRefundStatus().equals(other.getRefundStatus()))
            && (this.getTradeFinishTime() == null ? other.getTradeFinishTime() == null : this.getTradeFinishTime().equals(other.getTradeFinishTime()))
            && (this.getTradingChannel() == null ? other.getTradingChannel() == null : this.getTradingChannel().equals(other.getTradingChannel()))
            && (this.getThirdOrderId() == null ? other.getThirdOrderId() == null : this.getThirdOrderId().equals(other.getThirdOrderId()))
            && (this.getDispatchTime() == null ? other.getDispatchTime() == null : this.getDispatchTime().equals(other.getDispatchTime()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getPurNum() == null ? other.getPurNum() == null : this.getPurNum().equals(other.getPurNum()))
            && (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()))
            && (this.getRealPayAmount() == null ? other.getRealPayAmount() == null : this.getRealPayAmount().equals(other.getRealPayAmount()))
            && (this.getThirdRefundOrderId() == null ? other.getThirdRefundOrderId() == null : this.getThirdRefundOrderId().equals(other.getThirdRefundOrderId()))
            && (this.getCancelerName() == null ? other.getCancelerName() == null : this.getCancelerName().equals(other.getCancelerName()))
            && (this.getDiscountAmount() == null ? other.getDiscountAmount() == null : this.getDiscountAmount().equals(other.getDiscountAmount()))
            && (this.getServeAddress() == null ? other.getServeAddress() == null : this.getServeAddress().equals(other.getServeAddress()))
            && (this.getContactsPhone() == null ? other.getContactsPhone() == null : this.getContactsPhone().equals(other.getContactsPhone()))
            && (this.getContactsName() == null ? other.getContactsName() == null : this.getContactsName().equals(other.getContactsName()))
            && (this.getServeProviderStaffName() == null ? other.getServeProviderStaffName() == null : this.getServeProviderStaffName().equals(other.getServeProviderStaffName()))
            && (this.getServeProviderStaffPhone() == null ? other.getServeProviderStaffPhone() == null : this.getServeProviderStaffPhone().equals(other.getServeProviderStaffPhone()))
            && (this.getInstitutionName() == null ? other.getInstitutionName() == null : this.getInstitutionName().equals(other.getInstitutionName()))
            && (this.getInstitutionPhone() == null ? other.getInstitutionPhone() == null : this.getInstitutionPhone().equals(other.getInstitutionPhone()))
            && (this.getPlaceOrderTime() == null ? other.getPlaceOrderTime() == null : this.getPlaceOrderTime().equals(other.getPlaceOrderTime()))
            && (this.getServeStartTime() == null ? other.getServeStartTime() == null : this.getServeStartTime().equals(other.getServeStartTime()))
            && (this.getServeEndTime() == null ? other.getServeEndTime() == null : this.getServeEndTime().equals(other.getServeEndTime()))
            && (this.getRealServeStartTime() == null ? other.getRealServeStartTime() == null : this.getRealServeStartTime().equals(other.getRealServeStartTime()))
            && (this.getRealServeEndTime() == null ? other.getRealServeEndTime() == null : this.getRealServeEndTime().equals(other.getRealServeEndTime()))
            && (this.getServeBeforeImgs() == null ? other.getServeBeforeImgs() == null : this.getServeBeforeImgs().equals(other.getServeBeforeImgs()))
            && (this.getServeBeforeIllustrate() == null ? other.getServeBeforeIllustrate() == null : this.getServeBeforeIllustrate().equals(other.getServeBeforeIllustrate()))
            && (this.getServeAfterImgs() == null ? other.getServeAfterImgs() == null : this.getServeAfterImgs().equals(other.getServeAfterImgs()))
            && (this.getServeAfterIllustrate() == null ? other.getServeAfterIllustrate() == null : this.getServeAfterIllustrate().equals(other.getServeAfterIllustrate()))
            && (this.getPaymentTimeout() == null ? other.getPaymentTimeout() == null : this.getPaymentTimeout().equals(other.getPaymentTimeout()))
            && (this.getLon() == null ? other.getLon() == null : this.getLon().equals(other.getLon()))
            && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
            && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
            && (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime()))
            && (this.getCancelReason() == null ? other.getCancelReason() == null : this.getCancelReason().equals(other.getCancelReason()))
            && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
            && (this.getMonth() == null ? other.getMonth() == null : this.getMonth().equals(other.getMonth()))
            && (this.getDay() == null ? other.getDay() == null : this.getDay().equals(other.getDay()))
            && (this.getHour() == null ? other.getHour() == null : this.getHour().equals(other.getHour()))
            && (this.getSortTime() == null ? other.getSortTime() == null : this.getSortTime().equals(other.getSortTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getSync() == null ? other.getSync() == null : this.getSync().equals(other.getSync()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getServeTypeId() == null) ? 0 : getServeTypeId().hashCode());
        result = prime * result + ((getServeProviderId() == null) ? 0 : getServeProviderId().hashCode());
        result = prime * result + ((getServeProviderType() == null) ? 0 : getServeProviderType().hashCode());
        result = prime * result + ((getServeItemId() == null) ? 0 : getServeItemId().hashCode());
        result = prime * result + ((getServeId() == null) ? 0 : getServeId().hashCode());
        result = prime * result + ((getCityCode() == null) ? 0 : getCityCode().hashCode());
        result = prime * result + ((getServeTypeName() == null) ? 0 : getServeTypeName().hashCode());
        result = prime * result + ((getServeItemName() == null) ? 0 : getServeItemName().hashCode());
        result = prime * result + ((getServeItemImg() == null) ? 0 : getServeItemImg().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getOrdersStatus() == null) ? 0 : getOrdersStatus().hashCode());
        result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode());
        result = prime * result + ((getRefundStatus() == null) ? 0 : getRefundStatus().hashCode());
        result = prime * result + ((getTradeFinishTime() == null) ? 0 : getTradeFinishTime().hashCode());
        result = prime * result + ((getTradingChannel() == null) ? 0 : getTradingChannel().hashCode());
        result = prime * result + ((getThirdOrderId() == null) ? 0 : getThirdOrderId().hashCode());
        result = prime * result + ((getDispatchTime() == null) ? 0 : getDispatchTime().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getPurNum() == null) ? 0 : getPurNum().hashCode());
        result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
        result = prime * result + ((getRealPayAmount() == null) ? 0 : getRealPayAmount().hashCode());
        result = prime * result + ((getThirdRefundOrderId() == null) ? 0 : getThirdRefundOrderId().hashCode());
        result = prime * result + ((getCancelerName() == null) ? 0 : getCancelerName().hashCode());
        result = prime * result + ((getDiscountAmount() == null) ? 0 : getDiscountAmount().hashCode());
        result = prime * result + ((getServeAddress() == null) ? 0 : getServeAddress().hashCode());
        result = prime * result + ((getContactsPhone() == null) ? 0 : getContactsPhone().hashCode());
        result = prime * result + ((getContactsName() == null) ? 0 : getContactsName().hashCode());
        result = prime * result + ((getServeProviderStaffName() == null) ? 0 : getServeProviderStaffName().hashCode());
        result = prime * result + ((getServeProviderStaffPhone() == null) ? 0 : getServeProviderStaffPhone().hashCode());
        result = prime * result + ((getInstitutionName() == null) ? 0 : getInstitutionName().hashCode());
        result = prime * result + ((getInstitutionPhone() == null) ? 0 : getInstitutionPhone().hashCode());
        result = prime * result + ((getPlaceOrderTime() == null) ? 0 : getPlaceOrderTime().hashCode());
        result = prime * result + ((getServeStartTime() == null) ? 0 : getServeStartTime().hashCode());
        result = prime * result + ((getServeEndTime() == null) ? 0 : getServeEndTime().hashCode());
        result = prime * result + ((getRealServeStartTime() == null) ? 0 : getRealServeStartTime().hashCode());
        result = prime * result + ((getRealServeEndTime() == null) ? 0 : getRealServeEndTime().hashCode());
        result = prime * result + ((getServeBeforeImgs() == null) ? 0 : getServeBeforeImgs().hashCode());
        result = prime * result + ((getServeBeforeIllustrate() == null) ? 0 : getServeBeforeIllustrate().hashCode());
        result = prime * result + ((getServeAfterImgs() == null) ? 0 : getServeAfterImgs().hashCode());
        result = prime * result + ((getServeAfterIllustrate() == null) ? 0 : getServeAfterIllustrate().hashCode());
        result = prime * result + ((getPaymentTimeout() == null) ? 0 : getPaymentTimeout().hashCode());
        result = prime * result + ((getLon() == null) ? 0 : getLon().hashCode());
        result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
        result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
        result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode());
        result = prime * result + ((getCancelReason() == null) ? 0 : getCancelReason().hashCode());
        result = prime * result + ((getYear() == null) ? 0 : getYear().hashCode());
        result = prime * result + ((getMonth() == null) ? 0 : getMonth().hashCode());
        result = prime * result + ((getDay() == null) ? 0 : getDay().hashCode());
        result = prime * result + ((getHour() == null) ? 0 : getHour().hashCode());
        result = prime * result + ((getSortTime() == null) ? 0 : getSortTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getSync() == null) ? 0 : getSync().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", serveTypeId=").append(serveTypeId);
        sb.append(", serveProviderId=").append(serveProviderId);
        sb.append(", serveProviderType=").append(serveProviderType);
        sb.append(", serveItemId=").append(serveItemId);
        sb.append(", serveId=").append(serveId);
        sb.append(", cityCode=").append(cityCode);
        sb.append(", serveTypeName=").append(serveTypeName);
        sb.append(", serveItemName=").append(serveItemName);
        sb.append(", serveItemImg=").append(serveItemImg);
        sb.append(", unit=").append(unit);
        sb.append(", ordersStatus=").append(ordersStatus);
        sb.append(", payStatus=").append(payStatus);
        sb.append(", refundStatus=").append(refundStatus);
        sb.append(", tradeFinishTime=").append(tradeFinishTime);
        sb.append(", tradingChannel=").append(tradingChannel);
        sb.append(", thirdOrderId=").append(thirdOrderId);
        sb.append(", dispatchTime=").append(dispatchTime);
        sb.append(", price=").append(price);
        sb.append(", purNum=").append(purNum);
        sb.append(", totalAmount=").append(totalAmount);
        sb.append(", realPayAmount=").append(realPayAmount);
        sb.append(", thirdRefundOrderId=").append(thirdRefundOrderId);
        sb.append(", cancelerName=").append(cancelerName);
        sb.append(", discountAmount=").append(discountAmount);
        sb.append(", serveAddress=").append(serveAddress);
        sb.append(", contactsPhone=").append(contactsPhone);
        sb.append(", contactsName=").append(contactsName);
        sb.append(", serveProviderStaffName=").append(serveProviderStaffName);
        sb.append(", serveProviderStaffPhone=").append(serveProviderStaffPhone);
        sb.append(", institutionName=").append(institutionName);
        sb.append(", institutionPhone=").append(institutionPhone);
        sb.append(", placeOrderTime=").append(placeOrderTime);
        sb.append(", serveStartTime=").append(serveStartTime);
        sb.append(", serveEndTime=").append(serveEndTime);
        sb.append(", realServeStartTime=").append(realServeStartTime);
        sb.append(", realServeEndTime=").append(realServeEndTime);
        sb.append(", serveBeforeImgs=").append(serveBeforeImgs);
        sb.append(", serveBeforeIllustrate=").append(serveBeforeIllustrate);
        sb.append(", serveAfterImgs=").append(serveAfterImgs);
        sb.append(", serveAfterIllustrate=").append(serveAfterIllustrate);
        sb.append(", paymentTimeout=").append(paymentTimeout);
        sb.append(", lon=").append(lon);
        sb.append(", lat=").append(lat);
        sb.append(", payTime=").append(payTime);
        sb.append(", cancelTime=").append(cancelTime);
        sb.append(", cancelReason=").append(cancelReason);
        sb.append(", year=").append(year);
        sb.append(", month=").append(month);
        sb.append(", day=").append(day);
        sb.append(", hour=").append(hour);
        sb.append(", sortTime=").append(sortTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", sync=").append(sync);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}